<template>
    <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
        <!-- Indicators -->
        <ol class="carousel-indicators">
            <li v-for="(item, key) in items" :key="key"
                data-target="#carousel-example-generic"
                :data-slide-to="key" class="slide-li" :class="{active: key == 0}">
            </li>
        </ol>

        <div class="carousel-inner" role="listbox">
            <div v-for="(item, key) in items" class="item" :key="key" :class="{active: key == 0}">
                <a :href="item.url" :target="item.target">
                    <img :src="item.image">
                </a>
            </div>
        </div>

        <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
            <span class="sr-only">Previous</span>
        </a>
        <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
            <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
            <span class="sr-only">Next</span>
        </a>
    </div>
</template>

<script>
    export default {
        props: {
            items: {
                type: [Array],
                default: []
            }
        },
        name: "Slide"
    }
</script>

<style scoped>
    .slide-li {
        margin: 1px 5px;
    }
</style>